package com.orhon.smartcampus.modules.schoolaffairs.nm;


import com.orhon.smartcampus.modules.schoolaffairs.entity.SchoolChartSaying;
import com.orhon.smartcampus.modules.schoolaffairs.entity.SchoolOpinion;
import com.orhon.smartcampus.modules.schoolaffairs.gqlModel.GQLSchoolChartSaying;
import com.orhon.smartcampus.modules.schoolaffairs.gqlModel.GQLSchoolOpinion;
import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface SchoolChartSayingMapper {

    SchoolChartSayingMapper MAPPER = Mappers.getMapper(SchoolChartSayingMapper.class);

    @Mappings({
            @Mapping(source = "id" , target = "id"),
            @Mapping(source = "mkState" , target = "mkState"),
            @Mapping(source = "content" , target = "content"),
            @Mapping(source = "url" , target = "url"),
            @Mapping(source = "createdAt" , target = "created_at"),
            @Mapping(source = "createdBy" , target = "created_by"),
            @Mapping(source = "updatedAt" , target = "updated_at"),
            @Mapping(source = "deletedAt" , target = "deleted_at"),
            //@Mapping(ignore = true, target = "school"),
            @Mapping(ignore = true, target = "publisher"),
            //@Mapping(ignore = true, target = "receiveId"),
    })
    GQLSchoolChartSaying toSchoolChartSaying(SchoolChartSaying entity);

    @InheritConfiguration(name = "toSchoolChartSaying")
    List<GQLSchoolChartSaying> toSchoolChartSayingList(List<SchoolChartSaying> schoolChartSaying);
}
